package com.wanxi.mapper;

import com.wanxi.model.ClassifyQuery;
import com.wanxi.model.ProductInstanceQuery;
import com.wanxi.model.ProductQuery;
import com.wanxi.model.entity.Classify;
import com.wanxi.model.entity.Product;
import com.wanxi.model.entity.ProductInstance;
import com.wanxi.dto.ClassifyDTO;
import com.wanxi.dto.ProductDTO;
import com.wanxi.dto.ProductDetailDTO;
import com.wanxi.dto.ProductInstanceDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface ProductMapper {

    //  产品增删查改
    Integer addProduct(ProductDTO product);

    Integer insertDoctorToProduct(@Param("list")List<Long> doctorId,@Param("productId") Long productId);

    Integer updateProduct(@Param("id") Long id,@Param("product") ProductDTO product);

    Integer updateProductState(@Param("id") Long id,@Param("state") Integer state);

    List<ProductDetailDTO> findProductDetail(@Param("productId") Long productId);

    List<ProductDTO> findProduct(ProductQuery productQuery);

    List<Product> findProductBack(ProductQuery productQuery);

    //    服务实体增删查改

    Integer addProductInstance(ProductInstanceDTO productInstanceVo);

    List<ProductInstanceDTO> findProductInstance(ProductInstanceQuery productInstanceQuery);

    List<ProductInstance> findProductInstanceBack(ProductInstanceQuery productInstanceQuery);

    //    分类增删查改
    List<ClassifyDTO> findClassify(ClassifyQuery classifyQuery);

    Integer addClassify(ClassifyDTO classify);

    Integer updateClassify(@Param("id") Long id, @Param("classify") ClassifyDTO classify);

    Integer updateClassifyState(@Param("id") Long id, @Param("state") Integer state);

    List<Classify> findClassifyBack(ClassifyQuery classifyQuery);
}
